1. Technical Field
The present invention relates generally to an improved data processing system, and in particular a method and apparatus for processing graphics data. Still more particularly, the present invention provides a method, apparatus, and computer instructions for storing color maps in a data processing system.
2. Description of Related Art
Computer graphics concerns the synthesis or display of real or imaginary objects from computer-based models. In computer graphics systems, images are displayed on a display device to a user in two dimensional and three dimensional forms. These images are displayed using pixels. A pixel is short for a picture element. One spot in a rectilinear grid of thousands of such spots that are individually “painted” to form an image produced on the screen by a computer or on paper by a printer. A pixel is the smallest element that display or print hardware and software can manipulate in creating letters, numbers, or graphics. These pixels and information relating to these pixels are stored in a buffer. The information describing a pixel is identified using a window ID (WID). A WID is used as an index into a window attribute table (WAT). The WAT contains information describing how a pixel will be displayed on the screen. For example, a WAT identifies depth, color map, buffer, and gamma for a pixel.
In displaying pixels, a color table, also referred to as a “color lookup table,” is a piece of hardware in which pixel values or colors may be stored. A color map is a list of colors used to display pixels in a window or application. This list of colors must be loaded into a color table to be used. Presently, color tables on a graphics adapter are defined as fixed size tables with the most common size being 256 entries. This size color table is one required to support a fully populated 8-bit color map.
The present invention recognizes that many applications create color maps and only populate the first few entries, leaving many unused color table entries. Typically, each application will use a single color table for its color map. Most adapters provide very few color tables, resulting in the sharing of entries within a color table by applications. Such a sharing of color tables results in technicolor, which causes a window to be displayed with the wrong color map values. In other words, a window may be displayed with the incorrect colors due to a sharing of the color table with multiple applications.
Thus, it would be advantageous to have an improved method, apparatus, and computer instructions for storing and managing colors in a color table.